package com.example.springbootregister;

import cn.itcast.pojo.Country;
import cn.itcast.pojo.Province;
import com.example.anno.EnableCommonConfig;
import com.example.config.CommonConfig;
import com.example.config.CommonImportSelector;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

@SpringBootApplication
//@Import(CommonConfig.class)
//@Import(CommonImportSelector.class)
@EnableCommonConfig
public class SpringbootRegisterApplication {

    public static void main(String[] args) {
        ApplicationContext ac =
                SpringApplication.run(SpringbootRegisterApplication.class, args);

        // 验证是否被注入
        //Country country = ac.getBean(Country.class);
        //System.out.println(country);

        Province province = (Province) ac.getBean("province");
        System.out.println(province);
    }


}
